import { SIGN_STATUS_LIST, RESERVE_TYPE_LIST } from '@/const/type';
export const tableOption = () => {
  return {
    ...window.$crudMixins.tableOptions,
    addBtn: false,
    editBtn: false,
    delBtn: false,
    menuWidth: 120,
    labelWidth: 120,
    viewBtn: true,
    emptyBtn: false,
    submitBtn: false,
    column: [
      {
        label: '预约类型',
        prop: 'reserveType',
        span: 24,
        detail: true,
        row: true,
        type: 'select',
        dicData: RESERVE_TYPE_LIST,
      },
      {
        label: '预约记录编号',
        prop: 'id',
        detail: true,
      },
      {
        label: '预约人编号',
        prop: 'userCode',
        search: true,
        detail: true,
      },
      {
        label: '预约人昵称',
        prop: 'nickName',
        search: true,
        detail: true,
      },
      {
        label: '预约手机号',
        prop: 'phone',
        search: true,
        width: 160,
        detail: true,
      },
      {
        label: '籍贯（身份证）',
        prop: 'adCode',
        detail: true,
      },
      {
        label: '预约时间',
        prop: 'createTime',
        type: 'date',
        width: 160,
        format: 'yyyy-MM-dd',
        valueFormat: 'yyyy-MM-dd',
        searchRange: true,
        detail: true,
      },
      {
        label: '来访时间',
        prop: 'reserveTime',
        type: 'date',
        width: 160,
        format: 'yyyy-MM-dd',
        valueFormat: 'yyyy-MM-dd',
        search: true,
        searchRange: true,
        pickerOptions: {
          disabledDate: (time) => {
            return time.getTime() < Date.now() - 24 * 60 * 60 * 1000;
          },
        },
        rules: [
          {
            required: true,
            message: '请选择来访时间',
          },
        ],
      },
      {
        label: '宠物编号',
        prop: 'petCode',
        search: true,
        hide: true,
        detail: true,
      },
      {
        label: '关联宠物',
        prop: 'petName',
        detail: true,
      },
      {
        label: '爱心收容站',
        prop: 'baseName',
        search: true,
        overHidden: true,
        width: 160,
        detail: true,
      },
      {
        label: '签到状态',
        prop: 'status',
        type: 'select',
        dicData: SIGN_STATUS_LIST,
        search: true,
        detail: true,
      },
    ],
    group: [
      {
        label: '预约内容描述',
        prop: 'introductionGroup',
        arrow: false,
        labelWidth: 0,
        span: 24,
        column: [
          {
            placeholder: '请输入预约内容描述',
            prop: 'content',
            type: 'textarea',
            span: 24,
            row: true,
            detail: true,
          },
        ],
      },
      {
        label: '备注',
        prop: 'remarkGroup',
        arrow: false,
        labelWidth: 0,
        span: 24,
        column: [
          {
            labelWidth: 0,
            prop: 'remark',
            type: 'textarea',
            placeholder: '请输入备注',
            maxlength: 100,
            span: 24,
            minRows: 7,
            showWordLimit: true,
          },
        ],
      },
    ],
  };
};
export const petOption = () => {
  return {
    ...window.$crudMixins.tableOptions,
    addBtn: false,
    editBtn: false,
    delBtn: false,
    labelWidth: 120,
    viewBtn: true,
    emptyBtn: false,
    submitBtn: false,
    detail: true,
    group: [
      {
        label: '猫咪信息',
        arrow: false,
        column: [
          {
            label: '猫咪来源',
            prop: 'type',
            type: 'select',
            dicData: [
              {
                label: '自养',
                value: '1',
              },
              {
                label: '流浪猫救助',
                value: '2',
              },
            ],
          },
          {
            label: '猫咪年龄',
            prop: 'age',
          },
          {
            label: '猫咪名字',
            prop: 'petName',
          },
          {
            label: '猫咪品种',
            prop: 'varietyName',
          },
          {
            label: '猫咪性别',
            prop: 'gender',
          },
          {
            label: '健康情况',
            prop: 'health',
          },
          {
            label: '绝育情况',
            prop: 'sterilization',
            type: 'select',
            dicData: [
              {
                label: '未知',
                value: '0',
              },
              {
                label: '未绝育',
                value: '1',
              },
              {
                label: '已绝育',
                value: '2',
              },
            ],
          },
          {
            label: '猫咪喂养罐头',
            prop: 'foodCan',
          },
          {
            label: '猫咪喂食猫粮品牌',
            prop: 'foodBrand',
          },
          {
            label: '驱虫情况',
            prop: 'insectRepellent',
            type: 'select',
            dicData: [
              {
                label: '未知',
                value: '0',
              },
              {
                label: '未驱虫',
                value: '1',
              },
              {
                label: '已体内驱虫',
                value: '2',
              },
              {
                label: '已体外驱虫',
                value: '3',
              },
              {
                label: '已体内+体内驱虫',
                value: '4',
              },
            ],
          },
          {
            label: '疫苗情况',
            prop: 'vaccine',
            type: 'select',
            dicData: [
              {
                label: '未知',
                value: '0',
              },
              {
                label: '未疫苗',
                value: '1',
              },
              {
                label: '已疫苗',
                value: '2',
              },
            ],
          },
        ],
      },
    ],
  };
};
